package com.example.mountainwalker.service.impl;

import com.example.mountainwalker.entity.HotelInfo;
import com.example.mountainwalker.mapper.HotelMapper;
import com.example.mountainwalker.service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HotelServiceImpl implements HotelService {

    @Autowired
    private HotelMapper hotelMapper;

    @Override
    public List<HotelInfo> getAllHotel() {
        return hotelMapper.getAllHotel();
    }

    @Override
    public List<HotelInfo> searchHotelsByName(String name) {
        return hotelMapper.searchHotelsByName(name);
    }

    @Override
    public List<HotelInfo> searchHotelsByRegion(int regionId) {
        return hotelMapper.searchHotelsByRegion(regionId);
    }

    @Override
    public List<HotelInfo> searchHotelsByScenicSpot(int scenicSpotId) {
        return hotelMapper.searchHotelsByScenicSpot(scenicSpotId);
    }

    @Override
    public int addHotel(HotelInfo hotelInfo) {
        return hotelMapper.insertHotel(hotelInfo);
    }

    @Override
    public int updateHotel(HotelInfo hotelInfo) {
        return hotelMapper.updateHotel(hotelInfo);
    }

    @Override
    public int deleteHotel(int hotelId) {
        return hotelMapper.deleteHotel(hotelId);
    }

}